/*
 "id": "1876816740873162752",
                "createdAt": "2025-01-08 10:22:35",
                "name": "1",
                "userClassification": null,
                "phoneNumber": "13200000000",
                "age": 0,
                "birthDate": "2025-01-07",
                "gender": 1,
                "address": "1",
                "status": null,
                "workUnit": "",
                "incomeRange": "",
                "healthStatus": "",
                "diseaseType": null,
                "wechatId": "",
                "familyMembers": null,
                "childrenSituation": "",
                "isPhysicalExam": false,
                "serviceSpecialist": "",
                "note": "",
                "idCard": "",
                "unitProperty": "",
                "characterTrait": "",
                "exigencyUser": "",
                "exigencyMobile": "",
                "sourceUser": "",
                "operationFlag": false,
                "operationName": "",
                "medicine": "",
                "userPhoto": null
*/

/*
id:"",
createdAt:"",           // 创建时间
userPhoto:"",           // 用户头像
name:"",                // 姓名
userClassification:"",  // 用户分类
phoneNumber:"",         // 手机号
idCard:"",              // 身份证号
birthDate:"2025-01-07", // 生日
gender:1,               // 性别
age:55,                 // 年龄
address:"",             // 详细地址
wechatId:"",            // 微信号
workUnit:"",            // 单部名称
unitProperty:"",        // 单位性质
incomeRange:""          // 收入范围
status:"",              // 
healthStatus:"",        // 健康情况
familyMembers:"",     // 家庭成员
childrensituation:"", // 家庭成员情况
exigencyUser:"",      // 紧急联系人
exigencyMobile:"",    // 紧急联系电话
serviceSpecialist:"", // 服务专员
customenSource:"",    // 客户来源
isPhysicalExam:false, // 是否体检
operationFlag:false,  // 是否手术
operationName:"",     // 手术名称
medicine:"",          // 服用药品
diseaseType:null,     // 疾病类型
diseaseName:""        // 疾病名称
note:""               // 备注
characterTrait:"",    // 性格特征
sourceUser:"",        // 客户来源

*/
class UserInfo {
  final String? id;
  final String? createdAt;
  final String? name;
  final String? userClassification;
  final String? phoneNumber;
  final String? idCard;
  final String? birthDate;
  final int? gender;
  final int? age;
  final String? address;
  final String? wechatId;
  final String? workUnit;
  final String? unitProperty;
  final String? incomeRange;
  final String? status;
  final String? healthStatus;
  final String? familyMembers;
  final String? childrenSituation;
  final String? exigencyUser;
  final String? exigencyMobile;
  final String? serviceSpecialist;
  final bool? isPhysicalExam;
  final bool? operationFlag;
  final String? operationName;
  final String? medicine;
  final String? diseaseType;
  final String? diseaseName;
  final String? note;
  final String? characterTrait;
  final String? sourceUser;
  final String? userPhoto;
  UserInfo({
    this.id,
    this.createdAt,
    this.name,
    this.userClassification,
    this.phoneNumber,
    this.idCard,
    this.birthDate,
    this.gender,
    this.age,
    this.address,
    this.wechatId,
    this.workUnit,
    this.unitProperty,
    this.incomeRange,
    this.status,
    this.healthStatus,
    this.familyMembers,
    this.childrenSituation,
    this.exigencyUser,
    this.exigencyMobile,
    this.serviceSpecialist,
    this.isPhysicalExam,
    this.operationFlag,
    this.operationName,
    this.medicine,
    this.diseaseType,
    this.diseaseName,
    this.note,
    this.characterTrait,
    this.sourceUser,
    this.userPhoto,
  });

  factory UserInfo.fromJson(Map<String?, dynamic> json) {
    return UserInfo(
      id: json["id"] ?? '',
      createdAt: json["createdAt"] ?? '',
      name: json["name"] ?? '',
      userClassification: json["userClassification"] ?? '',
      phoneNumber: json["phoneNumber"] ?? '',
      idCard: json["idCard"] ?? '',
      birthDate: json["birthDate"] ?? '',
      gender: json["gender"] ?? 0,
      age: json["age"] ?? 0,
      address: json["address"] ?? '',
      wechatId: json["wechatId"] ?? '',
      workUnit: json["workUnit"] ?? '',
      unitProperty: json["unitProperty"] ?? '',
      incomeRange: json["incomeRange"] ?? '',
      status: json["status"] ?? '',
      healthStatus: json["healthStatus"] ?? '',
      familyMembers: json["familyMembers"] ?? '',
      childrenSituation: json["childrenSituation"] ?? '',
      exigencyUser: json["exigencyUser"] ?? '',
      exigencyMobile: json["exigencyMobile"] ?? '',
      serviceSpecialist: json["serviceSpecialist"] ?? '',
      isPhysicalExam: json["isPhysicalExam"] ?? false,
      operationFlag: json["operationFlag"] ?? false,
      operationName: json["operationName"] ?? '',
      medicine: json["medicine"] ?? '',
      diseaseType: json["diseaseType"] ?? '',
      diseaseName: json["diseaseName"] ?? '',
      note: json["note"] ?? '',
      characterTrait: json["characterTrait"] ?? '',
      sourceUser: json["sourceUser"] ?? '',
      userPhoto: json["userPhoto"] ?? '',
    );
  }

  toJson() {
    return {
      "id": id,
      "createdAt": createdAt,
      "name": name,
      "userClassification": userClassification,
      "phoneNumber": phoneNumber,
      "idCard": idCard,
      "birthDate": birthDate,
      "gender": gender,
      "age": age,
      "address": address,
      "wechat": wechatId,
      "workUnit": workUnit,
      "unitProperty": unitProperty,
      "incomeRange": incomeRange,
      "status": status,
      "healthStatus": healthStatus,
      "familyMembers": familyMembers,
      "childrenSituation": childrenSituation,
      "exigencyUser": exigencyUser,
      "exigencyMobile": exigencyMobile,
      "serviceSpecialist": serviceSpecialist,
      "isPhysicalExam": isPhysicalExam,
      "operationFlag": operationFlag,
      "operationName": operationName,
      "medicine": medicine,
      "diseaseType": diseaseType,
      "diseaseName": diseaseName,
      "note": note,
      "characterTrait": characterTrait,
      "sourceUser": sourceUser,
      "userPhoto": userPhoto,
    };
  }
}
